package ace.module.mail.address.core.impl.manager;

import ace.cmp.core.model.PageResultDto;
import ace.cmp.data.spring.data.jdbc.querydsl.rsql.core.manager.DtoManager;
import ace.module.mail.address.api.enums.MadMailAddressTypeEnum;
import ace.module.mail.address.api.model.dto.MadMailAddressDto;
import ace.module.mail.address.api.model.input.mailaddress.MadMailAddressFilterInput;
import ace.module.mail.address.core.impl.dao.entity.MadMailAddress;
import org.springframework.data.domain.Pageable;

/**
 * 邮寄地址 spring data jdbc querydsl rsql manager.
 *
 * @author Caspar
 */
public interface MadMailAddressManager extends DtoManager<MadMailAddress, Long, MadMailAddressDto> {


  PageResultDto<MadMailAddressDto> search(
      MadMailAddressFilterInput filter,
      Pageable pageable);

  long cancelDefault(Long madAppId, Long accountId, MadMailAddressTypeEnum typeEnum);

  MadMailAddressDto getDtoByOutIdAndOutTypeAndId(Long outId, String outType, Long mailAddressId);

  MadMailAddress getByOutIdAndOutTypeAndId(Long outId, String outType, Long mailAddressId);
}